package com.cicoding.bean;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.IdType;

import java.io.Serializable;
import java.util.Objects;

public class ErrorProblem extends Model<ErrorProblem> {
    private static final long serialVersionUID = 1L;

    @TableId(value="id", type= IdType.AUTO)
    private Integer id;
    private String title;
    private Integer answer; //用户的选择
    private Integer userId;
    private Integer rightAnswer;
    private Integer counts; //记录用户做题次数，用来标记
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    private String createTime;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ErrorProblem problem = (ErrorProblem) o;
        return Objects.equals(title, problem.title);
    }

    @Override
    public int hashCode() {
        return Objects.hash(title);
    }

    public Integer getRightAnswer() {
        return rightAnswer;
    }

    public Integer getCounts() {
        return counts;
    }

    public void setRightAnswer(Integer rightAnswer) {
        this.rightAnswer = rightAnswer;
    }

    public void setCounts(Integer counts) {
        this.counts = counts;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Integer getAnswer() {
        return answer;
    }

    public void setAnswer(Integer answer) {
        this.answer = answer;
    }

    public String getCreateTime() {
        return createTime;
    }


    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
